<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>YAMI4 - C++ general-purpose interface: yami::outgoing_message Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">YAMI4 - C++ general-purpose interface
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('classyami_1_1outgoing__message.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">yami::outgoing_message Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="yami::outgoing_message" -->
<p>Outgoing message.  
 <a href="classyami_1_1outgoing__message.html#details">More...</a></p>

<p><code>#include &lt;outgoing_message.h&gt;</code></p>

<p><a href="classyami_1_1outgoing__message-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1outgoing__message.html#a172fcc2695e952514ca97602d715c733">outgoing_message</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="#a172fcc2695e952514ca97602d715c733"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad7376ed2ea9706e9d6afd76e0e45a3ee"></a><!-- doxytag: member="yami::outgoing_message::get_state" ref="ad7376ed2ea9706e9d6afd76e0e45a3ee" args="() const " -->
<a class="el" href="namespaceyami.html#a2ecc684f5c66c0da36dbffe998a0132b">message_state</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1outgoing__message.html#ad7376ed2ea9706e9d6afd76e0e45a3ee">get_state</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the state of this message. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceyami.html#a2ecc684f5c66c0da36dbffe998a0132b">message_state</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1outgoing__message.html#aff2b3c18d2480f8d598cd1ddb385cac6">get_state</a> (std::size_t &amp;sent_bytes, std::size_t &amp;total_byte_count) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the state of this message.  <a href="#aff2b3c18d2480f8d598cd1ddb385cac6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1outgoing__message.html#aef2b3aaa7e6011f56e3e51d8b9b6eadb">wait_for_transmission</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Waits for the transmission to finish.  <a href="#aef2b3aaa7e6011f56e3e51d8b9b6eadb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1outgoing__message.html#ae603bc15a0671a8212312721aad0d936">wait_for_transmission</a> (std::size_t relative_timeout) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Waits for the transmission to finish or until timeout expires.  <a href="#ae603bc15a0671a8212312721aad0d936"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1outgoing__message.html#a684650abd0ec6f215493079c38f27b75">wait_for_transmission_absolute</a> (unsigned long long timeout) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Waits for the transmission to finish or until timeout expires.  <a href="#a684650abd0ec6f215493079c38f27b75"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1outgoing__message.html#a3f8391687e0e75f9067b1d14f0b0390b">wait_for_completion</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Waits for the full message roundtrip.  <a href="#a3f8391687e0e75f9067b1d14f0b0390b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1outgoing__message.html#a3ed195b9f8e74875bf342eee2daa8891">wait_for_completion</a> (std::size_t relative_timeout) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Waits for the message roundtrip or until timeout expires.  <a href="#a3ed195b9f8e74875bf342eee2daa8891"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1outgoing__message.html#a0d0c0e2bd3dac017bdb9e5343db097a6">wait_for_completion_absolute</a> (unsigned long long timeout) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Waits for the message roundtrip or until timeout expires.  <a href="#a0d0c0e2bd3dac017bdb9e5343db097a6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab5dbfdcb7ad2aaccf785451a7d376564"></a><!-- doxytag: member="yami::outgoing_message::get_reply" ref="ab5dbfdcb7ad2aaccf785451a7d376564" args="() const " -->
const <a class="el" href="classyami_1_1parameters.html">parameters</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1outgoing__message.html#ab5dbfdcb7ad2aaccf785451a7d376564">get_reply</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides access to the reply content. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const std::vector&lt; char &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1outgoing__message.html#a24ae1ed48e6bfe59ea06a420aa74828a">get_raw_reply</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides access to the reply content.  <a href="#a24ae1ed48e6bfe59ea06a420aa74828a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classyami_1_1parameters.html">parameters</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1outgoing__message.html#a6eaab4ee01c613b5d06940bf50e3141c">extract_reply</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Extracts the reply content.  <a href="#a6eaab4ee01c613b5d06940bf50e3141c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1outgoing__message.html#a027a49048c15dc15938373a12346b492">get_exception_msg</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the exception message.  <a href="#a027a49048c15dc15938373a12346b492"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>The handler allowing to track the progress of outgoing message, inspect its state and to obtain the reply content.</p>
<p><b>Note:</b> The objects of this class can be safely used from multiple threads. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a172fcc2695e952514ca97602d715c733"></a><!-- doxytag: member="yami::outgoing_message::outgoing_message" ref="a172fcc2695e952514ca97602d715c733" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">outgoing_message::outgoing_message </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Creates uninitialized outgoing message object. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aff2b3c18d2480f8d598cd1ddb385cac6"></a><!-- doxytag: member="yami::outgoing_message::get_state" ref="aff2b3c18d2480f8d598cd1ddb385cac6" args="(std::size_t &amp;sent_bytes, std::size_t &amp;total_byte_count) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceyami.html#a2ecc684f5c66c0da36dbffe998a0132b">message_state</a> outgoing_message::get_state </td>
          <td>(</td>
          <td class="paramtype">std::size_t &amp;&#160;</td>
          <td class="paramname"><em>sent_bytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::size_t &amp;&#160;</td>
          <td class="paramname"><em>total_byte_count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function allows to inspect the progress of the message transmission. During transmission the <code>sent_bytes</code> value is always smaller than <code>total_byte_count</code>. When these two values become equal, it means that the transmission was either succesful or abandoned.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">sent_bytes</td><td>The number of bytes that were already sent for this message. </td></tr>
    <tr><td class="paramname">total_byte_count</td><td>The total number of bytes that should be sent for this message. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aef2b3aaa7e6011f56e3e51d8b9b6eadb"></a><!-- doxytag: member="yami::outgoing_message::wait_for_transmission" ref="aef2b3aaa7e6011f56e3e51d8b9b6eadb" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void outgoing_message::wait_for_transmission </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Waits for the transmission to finish - that is, to either send all the message data or to abandon it. After this function returns the state of the message is either <code>transmitted</code>, <code>abandoned</code>, <code>replied</code> or <code>rejected</code>. </p>

</div>
</div>
<a class="anchor" id="ae603bc15a0671a8212312721aad0d936"></a><!-- doxytag: member="yami::outgoing_message::wait_for_transmission" ref="ae603bc15a0671a8212312721aad0d936" args="(std::size_t relative_timeout) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool outgoing_message::wait_for_transmission </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>relative_timeout</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Waits for the transmission to finish or until the given relative timeout expires.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">relative_timeout</td><td>The relative timeout in milliseconds. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li><code>true</code> if the wait completed before the timeout</li>
<li><code>false</code> if the timeout expired before the message was fully transmitted </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="a684650abd0ec6f215493079c38f27b75"></a><!-- doxytag: member="yami::outgoing_message::wait_for_transmission_absolute" ref="a684650abd0ec6f215493079c38f27b75" args="(unsigned long long timeout) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool outgoing_message::wait_for_transmission_absolute </td>
          <td>(</td>
          <td class="paramtype">unsigned long long&#160;</td>
          <td class="paramname"><em>timeout</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Waits for the transmission to finish or until the given absolute timeout expires.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">timeout</td><td>The absolute timeout expressed in milliseconds from the beginning of the epoch (UTC). </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li><code>true</code> if the wait completed before the timeout</li>
<li><code>false</code> if the timeout expired before the message was fully transmitted </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="a3f8391687e0e75f9067b1d14f0b0390b"></a><!-- doxytag: member="yami::outgoing_message::wait_for_completion" ref="a3f8391687e0e75f9067b1d14f0b0390b" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void outgoing_message::wait_for_completion </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Waits for the full message roundtrip - that is, for some confirmation that the message has been received and reacted upon by the target agent. After this function returns the state of the message is either <code>abandoned</code>, <code>replied</code> or <code>rejected</code>.</p>
<p><b>Note:</b> This function should not be called if the intended semantics of the message is "one-way" - in this case this function would block indefinitely. </p>

</div>
</div>
<a class="anchor" id="a3ed195b9f8e74875bf342eee2daa8891"></a><!-- doxytag: member="yami::outgoing_message::wait_for_completion" ref="a3ed195b9f8e74875bf342eee2daa8891" args="(std::size_t relative_timeout) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool outgoing_message::wait_for_completion </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>relative_timeout</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Waits for the full message roundtrip or until the given relative timeout expires.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">relative_timeout</td><td>The relative timeout in milliseconds. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li><code>true</code> if the wait completed before the timeout</li>
<li><code>false</code> if the timeout expired before the message was completed </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="a0d0c0e2bd3dac017bdb9e5343db097a6"></a><!-- doxytag: member="yami::outgoing_message::wait_for_completion_absolute" ref="a0d0c0e2bd3dac017bdb9e5343db097a6" args="(unsigned long long timeout) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool outgoing_message::wait_for_completion_absolute </td>
          <td>(</td>
          <td class="paramtype">unsigned long long&#160;</td>
          <td class="paramname"><em>timeout</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Waits for the full message roundtrip or until the given absolute timeout expires.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">timeout</td><td>The absolute timeout expressed in milliseconds from the beginning of the epoch (UTC). </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li><code>true</code> if the wait completed before the timeout</li>
<li><code>false</code> if the timeout expired before the message was completed </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="a24ae1ed48e6bfe59ea06a420aa74828a"></a><!-- doxytag: member="yami::outgoing_message::get_raw_reply" ref="a24ae1ed48e6bfe59ea06a420aa74828a" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const std::vector&lt; char &gt; &amp; outgoing_message::get_raw_reply </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Note: this function can be used only when the data is delivered in the raw buffer form. </p>

</div>
</div>
<a class="anchor" id="a6eaab4ee01c613b5d06940bf50e3141c"></a><!-- doxytag: member="yami::outgoing_message::extract_reply" ref="a6eaab4ee01c613b5d06940bf50e3141c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classyami_1_1parameters.html">parameters</a> * outgoing_message::extract_reply </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The reply content is moved to the caller and the caller becomes the owner of the <code>parameters</code> object. This object itself is no longer holding any references to the content and therefore any future attempts to access it will result in the exception. </p>

</div>
</div>
<a class="anchor" id="a027a49048c15dc15938373a12346b492"></a><!-- doxytag: member="yami::outgoing_message::get_exception_msg" ref="a027a49048c15dc15938373a12346b492" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const std::string &amp; outgoing_message::get_exception_msg </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function can be called when the state of message is "rejected". </p>

</div>
</div>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceyami.html">yami</a>      </li>
      <li class="navelem"><a class="el" href="classyami_1_1outgoing__message.html">outgoing_message</a>      </li>

    <li class="footer">Generated on Tue Aug 6 2013 22:41:16 for YAMI4 - C++ general-purpose interface by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
